<template>
  <div>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="已确认" name="first">
        <Confirmed v-if="isFirst" :competition-info="competitionInfo" />
      </el-tab-pane>
      <el-tab-pane label="报项人员名单" name="second">
        <Unconfirmed v-if="isSecond" :competition-info="competitionInfo" />
      </el-tab-pane>
      <el-tab-pane label="报名机构" name="third">
        <Degelation v-if="isThird" :competition-info="competitionInfo" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import Confirmed from './confirmed';
import Unconfirmed from './unconfirmed';
import Degelation from './degelation';
export default {
  name: 'PersonalDetails',
  components: {
    Confirmed,
    Unconfirmed,
    Degelation
  },
  props: {
    competitionInfo: {
      type: Object,
      default () {
        return {};
      }
    }
  },
  data() {
    return {
      activeName: 'first',
      isFirst: true,
      isSecond: false,
      isThird: false
    };
  },
  created() {
  },
  methods: {
    handleClick(tab) {
      if (tab.name === 'first') {
        this.isFirst = true;
        this.isSecond = false;
        this.isThird = false;
      } else if (tab.name === 'second') {
        this.isFirst = false;
        this.isSecond = true;
        this.isThird = false;
      } else if (tab.name === 'third') {
        this.isFirst = false;
        this.isSecond = false;
        this.isThird = true;
      }
    }
  }
};
</script>

